﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace ReportingManagement.Models
{
    public class Query : INotifyPropertyChanged
    {
        private int _Id;
        public int Id
        {
            get
            {
                return _Id;
            }
            set
            {
                _Id = value;
                OnPropertyChanged(new PropertyChangedEventArgs("Id"));
            }
        }

        private string _Name;
        public string Name
        {
            get
            {
                return _Name;
            }
            set
            {
                _Name = value;
                OnPropertyChanged(new PropertyChangedEventArgs("Name"));
            }
        }

        private string _Description;
        public string Description
        {
            get
            {
                return _Description;
            }
            set
            {
                _Description = value;
                OnPropertyChanged(new PropertyChangedEventArgs("Description"));
            }
        }

        private string _InternalName;
        public string InternalName
        {
            get
            {
                return _InternalName;
            }
            set
            {
                _InternalName = value;
                OnPropertyChanged(new PropertyChangedEventArgs("InternalName"));
            }
        }

        private string _Definition;
        public string Definition
        {
            get
            {
                return _Definition;
            }
            set
            {
                _Definition = value;
                OnPropertyChanged(new PropertyChangedEventArgs("Definition"));
            }
        }

        public virtual QueryType QueryType { get; set; }
        public virtual IList<QueryCategory> QueryCategories { get; set; }

        public event PropertyChangedEventHandler PropertyChanged;
        private void OnPropertyChanged(PropertyChangedEventArgs e)
        {
            if (PropertyChanged != null) PropertyChanged(this, e);
        }        
    }
}
